package cn.t215.cloud.api.user;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "t215-user-service", fallbackFactory = UserServiceRemoteClientFallbackFacotry.class)
public interface UserServiceRemoteClient {
    @GetMapping("")
    String hello();
    @GetMapping("/users")

    List<UserDTO> users();
    @PostMapping("/users")
    UserDTO save(UserDTO user);
    @PostMapping("/users2")
    UserDTO save2(@RequestParam("user") UserDTO user);

    @GetMapping("/users/search")
    UserDTO users(@RequestParam String name, @RequestParam String password);
}
